// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {
    

    // LIFE-CYCLE CALLBACKS:

     onLoad () {
        //关闭大厅的子节点的子字点的子节点
        for(let a of this.node.children){
            if(a.name!="Background"){
                a.active=false;
            }
        }
     }

    start () {
        
    }

//人物头像
Cha(){
this.node.dispatchEvent(new cc.Event.EventCustom('cha',true));//向父节点大厅发信息
}

//排行榜
List(){
this.node.dispatchEvent(new cc.Event.EventCustom('list',true));
}

//商店
Shop(){
    this.node.dispatchEvent(new cc.Event.EventCustom('shop',true));
}

//局内配置
Oncon(){
    this.node.dispatchEvent(new cc.Event.EventCustom('oncon',true));
}

//设置
Confi(){
    this.node.dispatchEvent(new cc.Event.EventCustom('confi',true));
}

//邮箱
Mailb(){
    this.node.dispatchEvent(new cc.Event.EventCustom('mailb',true));
 
}

//公告栏
Not(){
    this.node.dispatchEvent(new cc.Event.EventCustom('not',true));
   
}

//抽奖
CJ(){
    this.node.dispatchEvent(new cc.Event.EventCustom('cj',true));
  
}

//开始游戏
Start(){
    this.node.dispatchEvent(new cc.Event.EventCustom('start',true));
    this.node.getChildByName("Roomna").active=false;
    this.node.getChildByName("Roompa").active=false;
   
}

//返回
Back(){
    this.node.dispatchEvent(new cc.Event.EventCustom('back',true));
}
    // update (dt) {}


}
